﻿<?php
  $hotKeyword = urldecode($_GET['keyword']);
  
	$hotKeyword = trim($hotKeyword);
	$hotKeyword = strip_tags($hotKeyword,""); //清除HTML如<br />等代码
	$hotKeyword = str_replace("\n", "", str_replace(" ", "", $hotKeyword));//去掉空格和换行
	$hotKeyword = str_replace("\t","",$hotKeyword); //去掉制表符号
	$hotKeyword = str_replace("\r\n","",$hotKeyword); //去掉回车换行符号
	$hotKeyword = str_replace("\r","",$hotKeyword); //去掉回车
	$hotKeyword = str_replace("'","",$hotKeyword); 
	$hotKeyword = trim($hotKeyword);

  if (empty($hotKeyword)){
      header("location: http://www.gudahu.com");
      exit;
  } else if (preg_match("/^\d{6}$/",$hotKeyword)){
      //将请求转发至topHolderDetail.php
      header("location: http://www.gudahu.com/topHolderDetail.php?code=".$hotKeyword);
      exit;
  } else {
      //将请求转发至hotKeyword.php
      header("location: http://www.gudahu.com/hotKeyword.php?keyword=".$hotKeyword);
      exit;
  }
?>